package com.lrs.java.j2se_self.collectionReview;
import java.util.*;
public class ViewIterator {
	public static void main(String[] args){
		Collection c = new HashSet();
		c.add(new CompanyName("l1","z1"));
		c.add(new CompanyName("l2ss","z2ss"));
		c.add(new CompanyName("l3","z3"));
	/*	
		Iterator i = c.iterator();
		while(i.hasNext()){
			CompanyName cn = (CompanyName)i.next();
			System.out.println(cn.returnLName());
		}
	*/
		for(Iterator i = c.iterator();i.hasNext();){
			CompanyName cn = (CompanyName)i.next();
			if(cn.returnLName().length() > 3){
				i.remove();
			}
		}
		System.out.println(c);
	}
}
